import jdk.nashorn.internal.parser.Scanner;

public class Main {
    public static void main(String[] args) {
        int n = 123;
        while (n != 0){
            System.out.println(n % 10);
            n /= 10;
        }
    }

}